<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Image_lib extends CI_Controller {


	function index()
	{
		$config['image_library'] = 'gd2';
		$config['source_image'] = 'uploads/about.png';
		$config['create_thumb'] = TRUE;
		$config['maintain_ratio'] = TRUE;
		$config['width'] = 75;
		$config['height'] = 50;

		$this->load->library('image_lib', $config); 

		$this->image_lib->resize();
	}

	function crop()
	{
		$config['image_library'] = 'gd2';
		$config['source_image'] = 'uploads/about.png';
		$config['create_thumb'] = TRUE;
		$config['x_axis'] = '100';
		$config['y_axis'] = '60';
		$config['width'] = 75;
		$config['height'] = 50;
		
		$this->load->library('image_lib');
		$this->image_lib->clear();
		$this->image_lib->initialize($config); 

		if ( ! $this->image_lib->crop())
		{
			echo $this->image_lib->display_errors();
		}
	}

	function rotate()
	{
		$config['image_library'] = 'gb2';
		$config['source_image'] = 'uploads/about.png';
		$config['rotation_angle'] = 'hor';

		$this->load->library('image_lib');
		$this->image_lib->clear();
		$this->image_lib->initialize($config); 

		if ( ! $this->image_lib->rotate())
		{
			echo $this->image_lib->display_errors();
		}
	}

	function watermark()
	{
		$config['source_image'] = 'uploads/about.png';
		$config['wm_text'] = 'Copyright 2011 - John Doe';
		$config['wm_type'] = 'text';
		$config['wm_font_size'] = 5;
		$config['wm_font_color'] = '000000';
		$config['wm_vrt_alignment'] = 'bottom';
		$config['wm_hor_alignment'] = 'center';
		$config['wm_padding'] = -40;

		$this->load->library('image_lib');

		$this->image_lib->initialize($config); 

		$this->image_lib->watermark();
	}
}

/* End of file image_lib.php */
/* Location: ./application/controllers/image_lib.php */